package com.ifudata.dataexpert.constants;

import java.util.HashMap;
import java.util.Map;

import com.ifudata.dvp.sdk.common.BaseConstants;

public class MktConstants extends BaseConstants {

	public static class ResCode {
		/** 成功 */
		public static final String SUCCESS = "SUCCESS";
		/** 失败 */
		public static final String FAILED = "FAILED";
	}
	
	
	/**
     * 一体化维系管理
     * @description
     */
    public static class Market {
        /**
         * 上传文件命名
         */
        public static final String FILE_NAME_PREFIX = "MARKET_USERS_";
    	/**
         * 临时文件位置
         */
        public static final String UPLOAD_TEMP_DIR = "/WEB-INF/temp";
        /**
         * txt文件后缀
         */
        public static final String TXT_FILE_SUFFIX = "txt";
        
        /**
         * csv文件后缀
         */
        public static final String CSV_FILE_SUFFIX = "csv";

        /**
         * zip文件后缀
         */
        public static final String ZIP_FILE_SUFFIX = "zip";
        
        /**
         * 默认最大文件60M
         */
        public static final int MAX_FILE_SIZE = 60 * 1024 * 1024;
        /**
         * 下划线
         */
        public static final String UNDERLINE = "_";
        /**
         * 时间戳格式
         */
        public static final String HHmmssSSS = "HHmmssSSS";
    }
    
	public static class Common {

		/** 状态 */
		public static class Status {
			/** 失效（否） */
			public static final String INACTIVE = "0";
			/** 有效（是） */
			public static final String ACTIVE = "1";
		}
	}
	
    public static class MktChannelRuleDef {
        
        /**
         * ChannelRuleId
         * @description
         * @Modifier
         */
        public static class PushChannelId {
            /** 微信*/
            public static final Long WECHAT = 1L;
            /** 短信*/
            public static final Long SMS = 2L;
            /** 弹窗*/
            public static final Long PANEl = 3L;
            /** 手厅*/
            public static final Long HAND_CAFE = 4L;
            /** 网厅*/
            public static final Long NET_CAFE = 5L;
            /** 外呼*/
            public static final Long OUT_CALL = 6L;
            /** 客户经理*/
            public static final Long MANAGER = 7L;
            
        }
        
        /**
         * 渠道对应字段
         */
        public static Map<Long, String> pushChannelColumnMap = new HashMap<Long, String>();
        static{
            pushChannelColumnMap.put(PushChannelId.WECHAT, "wechat_flag");
            pushChannelColumnMap.put(PushChannelId.SMS, "sms_flag");
            pushChannelColumnMap.put(PushChannelId.PANEl, "tc_flag");
            pushChannelColumnMap.put(PushChannelId.HAND_CAFE, "st_flag");
            pushChannelColumnMap.put(PushChannelId.NET_CAFE, "wt_flag");
            pushChannelColumnMap.put(PushChannelId.OUT_CALL, "wh_falg");
            pushChannelColumnMap.put(PushChannelId.MANAGER, "jtkhjl_flag");
        }
        
        /**
         * 渠道对应字段
         */
        public static Map<Long, String> pushChannelNameColumnMap = new HashMap<Long, String>();
        static{
            pushChannelNameColumnMap.put(PushChannelId.WECHAT, "微信");
            pushChannelNameColumnMap.put(PushChannelId.SMS, "短信");
            pushChannelNameColumnMap.put(PushChannelId.PANEl, "弹窗");
            pushChannelNameColumnMap.put(PushChannelId.HAND_CAFE, "手厅");
            pushChannelNameColumnMap.put(PushChannelId.NET_CAFE, "网厅");
            pushChannelNameColumnMap.put(PushChannelId.OUT_CALL, "外呼");
            pushChannelNameColumnMap.put(PushChannelId.MANAGER, "集团客户经理");
        }
    }
    
    /**
     * 活动状态
     * @description
     * @author yuhuan 2018年4月3日
     * @Modifier
     */
    public static class ActivityStatus {
    	/** 待审核*/
    	public static final String STATUS_PRE_APPROVE = "1";
    	/** 审核成功*/
    	public static final String STATUS_APPROVE_SUCCESS = "2";
    	/** 审核失败 */
    	public static final String STATUS_APPROVE_FAIL = "3";
    	/** 已开始 */
    	public static final String STATUS_BEGIN = "4";
    	/** 暂停 */
    	public static final String STATUS_SUSPEND = "5";
    	/** 删除*/
    	public static final String STATUS_DELETE = "6";
    	/** 结束*/
    	public static final String STATUS_FINISH = "7";
		/** 关闭*/
		public static final String STATUS_CLOSE = "8";
		
		// 以下表中没有的状态
		/** 二次营销*/
		public static final String STATUS_AGAIN = "9";
    }
    
    /**
     * 获取活动状态解释
     * @param status
     * @return
     */
    public static String getActivityStatusName(String status) {
    	String name;
    	switch (status) {
			case ActivityStatus.STATUS_PRE_APPROVE :
				name = "待审核";
				break;
			case ActivityStatus.STATUS_APPROVE_SUCCESS :
				name = "审核成功";
				break;
			case ActivityStatus.STATUS_APPROVE_FAIL :
				name = "审核失败";
				break;
			case ActivityStatus.STATUS_BEGIN :
				name = "已开始";
				break;
			case ActivityStatus.STATUS_SUSPEND :
				name = "暂停";
				break;
			case ActivityStatus.STATUS_DELETE :
				name = "删除";
				break;
			case ActivityStatus.STATUS_FINISH :
				name = "结束";
				break;
			case ActivityStatus.STATUS_CLOSE :
				name = "关闭";
				break;
			default :
				name = "未知";
				break;
		}
    	return name;
	}
    
    public static String getActivityStatusColor(String status) {
    	String name;
    	switch (status) {
			case ActivityStatus.STATUS_PRE_APPROVE :
				//"待审核";
				name = "#fcc774";
				break;
			case ActivityStatus.STATUS_APPROVE_SUCCESS :
				//"审核成功";
				name = "#ffa851";
				break;
			case ActivityStatus.STATUS_APPROVE_FAIL :
				//"审核失败";
				name = "#b0f75d";
				break;
			case ActivityStatus.STATUS_BEGIN :
				//"已开始";
				name = "#19f8aa";
				break;
			case ActivityStatus.STATUS_SUSPEND :
				//"暂停";
				name = "#1cf8e6";
				break;
			case ActivityStatus.STATUS_DELETE :
				//"删除";
				name = "#8cd0b5";
				break;
			case ActivityStatus.STATUS_FINISH :
				//"结束";
				name = "#d976da";
				break;
			case ActivityStatus.STATUS_CLOSE :
				//"关闭";
				name = "#f3927f";
				break;
			default :
				//"未知";
				name = "#f3927f";
				break;
		}
    	return name;
	}
}
